package com.ykdl.member.kid.beans;

import net.wxxr.http.interfaces.IJsonParser;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class Sleeping extends Nursing {
	
	private float begin_time;//开始时间
	private float end_time;//结束时间
	private int duration;//时长(分钟)
	
	public Sleeping(){}
	
	public Sleeping(long id, long actor_id, int nursing_type,
			float create_time, float begin_time, float end_time, int duration) {
		super(id, actor_id, nursing_type, create_time);
		this.begin_time = begin_time;
		this.end_time = end_time;
		this.duration = duration;
	}

	@Override
	public int getNursing_type() {
		return NURSING_RECORD_TYPE_SLEEPING;
	}
	
	public float getBegin_time() {
		return begin_time;
	}
	public void setBegin_time(float begin_time) {
		this.begin_time = begin_time;
	}
	public float getEnd_time() {
		return end_time;
	}
	public void setEnd_time(float end_time) {
		this.end_time = end_time;
	}
	public int getDuration() {
		return duration;
	}
	public void setDuration(int duration) {
		this.duration = duration;
	}
	@Override
	public IJsonParser parse(String json) throws Exception {
		Gson gson = null;
		if (gson == null) {
			GsonBuilder builder = new GsonBuilder();
			gson = builder.create();
			return gson.fromJson(json, Sleeping.class);
		}
		return null;
	}
}
